home *** CD-ROM | disk | FTP | other *** search
/ Animedia 38 / Animediacd38.iso / Extra / winamp511.exe / $R0 / Winamp Modern / scripts / seekshade.m < prev    next >
Text File  |  2005-09-15  |  1KB  |  58 lines

  1. #include <lib/std.mi>
  2.  
  3. Global Group frameGroup;
  4. Global Slider Seeker;
  5. Global Int Seeking;
  6. Global Timer SongTickerTimer;
  7. Global Text SongTicker;
  8.  
  9. System.onScriptLoaded() {
  10.  
  11.     frameGroup = getScriptGroup();
  12.     Seeker = frameGroup.findObject("shadeSeekerGhost");
  13.     SongTicker = frameGroup.findObject("SongtickerShade");
  14.  
  15.     SongTickerTimer = new Timer;
  16.     SongTickerTimer.setDelay(1000);
  17.  
  18. }
  19.  
  20. SongTickerTimer.onTimer() {
  21.     SongTicker.setText("");
  22.     SongTickerTimer.stop();
  23. }
  24.  
  25. System.onScriptUnloading() {
  26.     delete SongTickerTimer;
  27. }
  28.  
  29.  
  30. Seeker.onSetPosition(int p) {
  31.     if (seeking) {
  32.         Float f;
  33.         f = p;
  34.         f = f / 255 * 100;
  35.         Float len = getPlayItemLength();
  36.         if (len != 0) {
  37.             int np = len * f / 100;
  38.             SongTickerTimer.start();
  39.             SongTicker.setText("SEEK:" + integerToTime(np) + "/" + integerToTime(len) + " (" + integerToString(f) + "%) ");
  40.         }
  41.     }
  42. }
  43.  
  44.  
  45. Seeker.onLeftButtonDown(int x, int y) {
  46.     seeking = 1;
  47. }
  48.  
  49. Seeker.onLeftButtonUp(int x, int y) {
  50.     seeking = 0;
  51.     SongTickerTimer.start();
  52.     SongTicker.setText("");
  53. }
  54.  
  55. Seeker.onSetFinalPosition(int p) {
  56.     SongTickerTimer.start();
  57.     SongTicker.setText("");
  58. }